﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Acceron.Univerisy.Modules.Scheduling
{
    /// <summary>
    /// Interaction logic for RoomControl.xaml
    /// </summary>
    public partial class RoomControl : UserControl
    {
        public RoomControl()
        {
            InitializeComponent();
            roomGrid.ShowGridLines = true;
        }

        public void AddNewCourse(int day, int time, int dur, string txt)
        {
            Border nBord = new Border();
            nBord.SetValue(Grid.ColumnProperty, day);
            nBord.SetValue(Grid.RowProperty, time);
            nBord.SetValue(Grid.RowSpanProperty, dur);
            nBord.Height = roomGrid.RowDefinitions[0].ActualHeight;
            nBord.Width = roomGrid.ColumnDefinitions[0].ActualWidth;
            nBord.BorderThickness = new Thickness(2.5);
            nBord.BorderBrush = Brushes.Black;

            Label lbl = new Label()
            {
                Content = txt
                //Height = roomGrid.RowDefinitions[0].ActualHeight,
                //Width = roomGrid.ColumnDefinitions[0].ActualWidth
            };

            lbl.SetValue(Grid.ColumnProperty, day);
            lbl.SetValue(Grid.RowProperty, time);

            roomGrid.Children.Add(lbl);

            roomGrid.Children.Add(nBord);
        }

        public void Clear()
        {
            roomGrid.Children.Clear();
        }
    }
}
